package com.bac.rentmap.web.controller.ad.batch;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.bac.rentmap.ad.batch.Batchable;

public class BatchQueuingController extends AbstractController {
    private Batchable batchable;

    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        int count = batchable.getQueueSize();
        response.getWriter().print(count);
        return null;
    }

    @Required
    public void setBatchable(Batchable batchable) {
        this.batchable = batchable;
    }
}
